home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 4
/
FM Towns Free Software Collection 4 - Disc 1.iso
/
fb386
/
superedt
/
s_unit.bas
< prev
next >
Wrap
BASIC Source File
|
1991-10-18
|
9KB
|
234 lines
1000 '
1010 ' SUPER 大戦略
1020 ' UNIT EDITOR
1030 ' FOR FM-TOWNS
1040 '
1050 ' 注、UNITV.DATを書き込み可にしておくこと。
1060 '
1070 SCREEN@ 0:CLS:COLOR 7,0,7,0:DEFINT A-Z:WIDTH 80,25:CONSOLE 0,24,2
1100 DEF FNDATA(X)=ASC(MID$(UNIT$,X,1))
1110 DIM DAT$(5),UNIT$(125),MOVE$(11),SIKIBE1$(3),SIKIBE2$(9),WEAPON$(15),Y(14)
1130 OPEN "UNITV.DAT" FOR INPUT AS #1
1140 DAT$(0)=INPUT$(246,1)
1150 DAT$(1)=INPUT$(200,1)
1160 DAT$(2)=INPUT$(200,1)
1170 DAT$(3)=INPUT$(200,1)
1180 DAT$(4)=INPUT$(200,1)
1190 FOR I=0 TO 125
1200 UNIT$(I)=INPUT$(80,1)
1210 NEXT
1220 DAT$(5)=INPUT$(81,1):CLOSE #1
1230 OPEN "PARAM.DAT" FOR INPUT AS #1
1240 DAT$=INPUT$(131,1)
1250 DAT$=INPUT$(141,1)
1260 FOR I=0 TO 11
1270 MOVE$(I)=INPUT$(10,1)
1280 MOVE$(I)=MID$(MOVE$(I),1,4)
1290 NEXT
1300 DAT$=INPUT$(46,1)
1310 FOR I=0 TO 15
1320 WEAPON$(I)=INPUT$(18,1)
1330 WEAPON$(I)=MID$(WEAPON$(I),1,4)
1340 NEXT
1350 CLOSE #1
1360 FOR I=0 TO 3:READ SIKIBE1$(I):NEXT
1370 DATA 飛行機,ヘリコプター,陸上部隊,歩兵
1380 FOR I=0 TO 9:READ SIKIBE2$(I):NEXT
1390 DATA 戦闘機,攻撃機,ヘリ型補給部隊,輸送ヘリ
1400 DATA 戦車,対空,歩兵戦闘車,輸送車,補給車,歩兵
1430 FOR I=0 TO 14:READ Y(I):NEXT:X=0:Y=0:Y1=0
1440 DATA 0,1,2,3,4,5,6,7,9,10,17,20,21,22,23
1450 CLS
1455 FOR I=0 TO 24
1460 FOR J=0 TO 4
1470 A$=LEFT$(UNIT$(I*5+J),18)
1480 SYMBOL(J*128,I*16),A$,1,1,%7
1490 NEXT
1500 NEXT:F=0:F1=0
1510 A$=LEFT$(UNIT$(125),18)
1520 SYMBOL(0,25*16),A$,1,1,%7
1530 SYMBOL(128,25*16),"SAVE END",1,1,%7
1540 K$=""
1550 LINE(X*128,Y*16)-(X*128+127,Y*16+15),XOR,%7,BF
1560 WHILE K$<>" "
1570 K$=INPUT$(1)
1580 VX=(ASC(K$)=29 AND X>0)-(ASC(K$)=28 AND X<4)
1590 VY=(ASC(K$)=30 AND Y>0)-(ASC(K$)=31 AND Y<25)
1600 IF VX<>0 OR VY<>0 LINE(X*128,Y*16)-(X*128+127,Y*16+15),XOR,%7,BF
1610 X=X+VX:Y=Y+VY
1620 IF VX<>0 OR VY<>0 LINE(X*128,Y*16)-(X*128+127,Y*16+15),XOR,%7,BF
1630 WEND
1640 I=X+Y*5:IF I=126 THEN *END
1645 IF I=127 END
1650 IF I>125 THEN K$="":GOTO 1560
1655 UNIT$=UNIT$(I)
1660 PALETTE 7,[0,0,0]
1670 PRINT" 名前:";LEFT$(UNIT$,18)
1680 PRINT" 移動型:";MOVE$(FNDATA(19)-1)
1690 PRINT" 燃料:";FNDATA(20)
1700 PRINT" 価格:";FNDATA(22)*256+FNDATA(21)
1710 PRINT" 移動力:";FNDATA(23)
1720 PRINT" 識別1:";SIKIBE1$(FNDATA(24))
1730 PRINT" 識別2:";SIKIBE2$(FNDATA(25)-1)
1740 PRINT" パラメータ:武装交換 飛行部隊 被補給 補給 輸送 被輸送 占領"
1750 A=FNDATA(26):A$=" ":IF A>63 A=A-64:B$="○" ELSE B$="×"
1760 A$=A$+B$+" ":IF A>31 A=A-32:B$="○" ELSE B$="×"
1770 A$=A$+B$+" " :IF A>15 A=A-16:B$="○" ELSE B$="×"
1780 A$=A$+B$+" " :IF A>7 A=A-8 :B$="○" ELSE B$="×"
1790 A$=A$+B$+" " :IF A>3 A=A-4 :B$="○" ELSE B$="×"
1800 A$=A$+B$+" " :IF A>1 A=A-2 :B$="○" ELSE B$="×"
1810 A$=A$+B$+" " :IF A>0 A=A-1 :B$="○" ELSE B$="×"
1820 A$=A$+B$:PRINT A$
1830 PRINT" 補充:";FNDATA(28)
1840 PRINT " 武器:名前 数 航空 ヘリ 陸上 兵員 "
1850 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(29)),FNDATA(35),FNDATA(43),FNDATA(44),FNDATA(45),FNDATA(46)
1860 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(30)),FNDATA(36),FNDATA(47),FNDATA(48),FNDATA(49),FNDATA(50)
1870 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(31)),FNDATA(37),FNDATA(51),FNDATA(52),FNDATA(53),FNDATA(54)
1880 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(32)),FNDATA(38),FNDATA(55),FNDATA(56),FNDATA(57),FNDATA(58)
1890 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(33)),FNDATA(39),FNDATA(59),FNDATA(60),FNDATA(61),FNDATA(62)
1900 PRINT USING" & & ## ## ## ## ##";WEAPON$(FNDATA(34)),FNDATA(40),FNDATA(63),FNDATA(64),FNDATA(65),FNDATA(66)
1910 PRINT " 攻撃力: 航空 ヘリ 陸上 兵員"
1920 PRINT USING" 第一武装 ## ## ## ##";FNDATA(67),FNDATA(68),FNDATA(69),FNDATA(70)
1930 PRINT USING" 第二武装 ## ## ## ##";FNDATA(71),FNDATA(72),FNDATA(73),FNDATA(74)
1940 PRINT " 対空防御:";FNDATA(41)
1950 PRINT " 対地防御:";FNDATA(42)
1960 PRINT " SAVE"
1970 PRINT " END";
1980 '---------------------------------------------------------EDITOR
1990 K$="":J=0
2000 LOCATE 0,Y(Y1):PRINT"●";
2010 WHILE J=0
2020 K$=INPUT$(1)
2030 VY=(ASC(K$)=30 AND Y1>0)-(ASC(K$)=31 AND Y1<14)
2040 IF VY<>0 LOCATE 0,Y(Y1):PRINT " ";
2050 Y1=Y1+VY:LOCATE 0,Y(Y1):PRINT "●";:IF K$=" "OR K$=CHR$(13) THEN J=1
2060 WEND:LOCATE 0,23:PRINT" ";
2070 ON Y1+1 GOSUB *A,*B,*C,*D,*E,*F,*G,*H,*I,*J,*K,*L,*M,*N,*O
2080 CLS 4:GOTO 1670
2090 '---------------------------------------------------------
2100 *A'名前
2110 LOCATE 0,23:LINE INPUT"NAME(ANKで17文字まで)";NA$
2120 IF NA$="" THEN 2150
2130 NA$=LEFT$(NA$+" ",17)
2140 MID$(UNIT$,1,17)=NA$:F=1
2150 RETURN
2160 *B'移動型
2170 FOR J=0 TO 11
2180 IF J=6 PRINT
2190 LOCATE J*8+(J>5)*48,23-(J>5):PRINT HEX$(J+1);MOVE$(J);
2200 NEXT:PRINT
2210 PRINT"No.":NO=VAL("&H"+INPUT$(1)):IF NO<1 OR NO>11 THEN RETURN
2220 MID$(UNIT$,19,1)=CHR$(NO)
2230 RETURN
2240 *C'燃料
2250 LOCATE 0,23:INPUT"燃料";FLUE:IF FLUE<0 OR FLUE>255 THEN RETURN
2260 MID$(UNIT$,20,1)=CHR$(FLUE)
2270 RETURN
2280 *D'価格
2290 LOCATE 0,23:INPUT"価格";MONEY!
2300 IF MONEY!<0 OR MONEY!>65535 THEN RETURN
2310 A=MONEY! MOD 256
2320 MID$(UNIT$,21,2)=CHR$(A)+CHR$((MONEY!-A)/256)
2330 RETURN
2340 *E'移動力
2350 LOCATE 0,23:INPUT"移動力";MOVE
2360 IF MOVE<0 OR MOVE>255 THEN RETURN
2370 MID$(UNIT$,23,1)=CHR$(MOVE)
2380 RETURN
2390 *F'識別1
2400 FOR J=0 TO 3
2410 LOCATE J*8,23:PRINT J;SIKIBE1$(J);
2420 NEXT:PRINT
2430 PRINT"No.",:NO$=INPUT$(1):IF NO$<"0" OR NO$>"3" THEN RETURN
2440 MID$(UNIT$,24,1)=CHR$(VAL(NO$))
2450 RETURN
2460 *G'識別2
2470 FOR J=0 TO 9
2480 IF J=5 PRINT
2490 LOCATE J*8+(J>4)*32,23-(J>4):PRINT HEX$(J+1);SIKIBE2$(J);
2500 NEXT:PRINT
2510 PRINT"No.",:NO$=INPUT$(1)
2520 IF(NO$<"0" OR NO$>"9")AND NO$<>"A" THEN RETURN
2530 IF NO$="A" THEN NO$="10"
2540 MID$(UNIT$,25,1)=CHR$(VAL(NO$))
2550 RETURN
2560 *I'補充
2570 LOCATE 0,23:INPUT"補充";A
2580 IF A<0 OR A>255 THEN RETURN
2590 MID$(UNIT$,28,1)=CHR$(A)
2600 RETURN
2610 *H'パラメーター
2620 LOCATE 0,23
2630 PRINT"1.武装交換 2.飛行部隊 3.被補給 4.補給 5.輸送 6.被輸送 7.占領"
2640 PRINT"どれを変更しますか?":NO$=INPUT$(1)
2650 IF NO$>"7" OR NO$<"1" THEN RETURN
2660 A=FNDATA(26):B=A:NO=7-VAL(NO$):IF NO=6 THEN 2700
2670 FOR J=6 TO NO+1 STEP -1
2680 IF B>2^J-1 THEN B=B-2^J
2690 NEXT
2700 IF B>2^NO-1 THEN A=A-2^NO ELSE A=A+2^NO
2710 MID$(UNIT$,26,1)=CHR$(A)
2720 RETURN
2730 *J'武装
2740 X2=0:Y2=0:J=0
2750 WHILE J=0
2760 LOCATE X2*5+9+(X2<>1),Y2+11:PRINT"*"
2770 K$=INPUT$(1)
2780 VX=(ASC(K$)=29 AND X2>0)-(ASC(K$)=28 AND X2<5)
2790 VY=(ASC(K$)=30 AND Y2>0)-(ASC(K$)=31 AND Y2<5)
2800 IF VX<>0 OR VY<>0 LOCATE X2*5+9+(X2<>1),Y2+11:PRINT " "
2810 Y2=Y2+VY:X2=X2+VX:IF K$=" " OR K$=CHR$(13) THEN J=1
2820 WEND
2830 IF K$=CHR$(13) THEN RETURN
2840 IF X2=0 THEN *J1
2850 LOCATE 0,23:INPUT "NO.",NO:IF NO<0 OR NO>255 THEN RETURN
2860 MID$(UNIT$,35-Y2*(X2=1)-Y2*(X2>1)*4-8*(X2>1)-(X2-2)*(X2>1),1)=CHR$(NO)
2870 RETURN
2880 *J1
2890 FOR J=0 TO 15
2900 IF J=8 THEN PRINT
2910 LOCATE J*8+(J>7)*64,23-(J>7):PRINT HEX$(J);".";WEAPON$(J);
2920 NEXT:PRINT
2930 PRINT"No.":NO=VAL("&h"+INPUT$(1))
2940 IF NO<0 OR NO>15 THEN RETURN
2950 MID$(UNIT$,29+Y2,1)=CHR$(NO)
2960 RETURN
2970 *K'攻撃力
2980 X2=0:Y2=0:J=0
2990 WHILE J=0
3000 LOCATE 13+X2*5,18+Y2:PRINT "*"
3010 K$=INPUT$(1)
3020 VX=(ASC(K$)=29 AND X2>0)-(ASC(K$)=28 AND X2<4)
3030 VY=(ASC(K$)=30 AND Y2>0)-(ASC(K$)=31 AND Y2<1)
3040 IF VX<>0 OR VY<>0 LOCATE 13+X2*5,18+Y2:PRINT " "
3050 Y2=Y2+VY:X2=X2+VX:IF K$=" " OR K$=CHR$(13) THEN J=1
3060 WEND
3070 IF K$=CHR$(13) RETURN
3080 LOCATE 0,23:INPUT "NO.",NO:IF NO<0 OR NO>255 THEN RETURN
3090 MID$(UNIT$,67+X2+Y2*4,1)=CHR$(NO)
3100 RETURN
3110 *L'対空防御力
3120 LOCATE 0,23:INPUT"対空防御";A
3130 IF A<0 OR A>255 THEN RETURN
3140 MID$(UNIT$,41,1)=CHR$(A)
3150 RETURN
3160 *M'対地防御力
3170 LOCATE 0,23:INPUT"対地防御";A
3180 IF A<0 OR A>255 THEN RETURN
3190 MID$(UNIT$,42,1)=CHR$(A)
3200 RETURN
3210 *N
3220 UNIT$(I)=UNIT$:F1=1
3240 *O
3250 K$=""
3260 PALETTE 7,[128,128,128]:CLS 1:IF F1=1 THEN 1450 ELSE 1560
3270 *END '--------------------------------------------------
3280 KILL"UNITV.DAT"
3290 OPEN "UNITV.DAT" FOR OUTPUT AS #1
3300 PRINT #1,DAT$(0);DAT$(1);DAT$(2);DAT$(3);DAT$(4);
3310 FOR I=0 TO 125
3320 PRINT #1,UNIT$(I);
3330 NEXT
3340 PRINT #1,DAT$(5);
3350 CLOSE #1